package flymoke.reflect;

import java.lang.reflect.Field;
import java.lang.reflect.Modifier;

public class ReflectGetField {
	public static void main(String[] args) {
		Class<?> cla = null;
		try {
			cla = Class.forName("flymoke.reflect.People");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		}
		
		Field fields[] = cla.getDeclaredFields();
		for(int i=0;i<fields.length;i++){
			int mon = fields[i].getModifiers();
			System.out.println(mon);
			String mod = Modifier.toString(mon);
			Class<?> type = fields[i].getType();
			System.out.println(mod+" "+type.getName()+" "+fields[i].getName());
		}
		System.out.println("----------------------------------------");
		Field field[] = cla.getFields();
		for(int i=0;i<field.length;i++){
			int mon = field[i].getModifiers();
			System.out.println(mon);
			String mod = Modifier.toString(mon);
			Class<?> type = field[i].getType();
			System.out.println(mod+" "+type.getName()+" "+fields[i].getName());
		}
	}
}
